﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using SilverlightDemo.Web.Models;

namespace SilverlightDemo.Web
{
    public class MonhocReport
    {
       public DataTable monhocs;
        List<MonHoc> lstMh=new List<MonHoc>();
        public MonhocReport()
        {
            monhocs = new DataTable();
            monhocs.TableName = "Monhoc";
            monhocs.Columns.Add("Mamh", typeof(int));
            monhocs.Columns.Add("Tenmh", typeof(string));
            monhocs.Columns.Add("Sotc", typeof(int));
            monhocs.Columns.Add("Hocphi", typeof(int));
            MonHocService mhservice = new MonHocService();
            lstMh = mhservice.GetAllMonHoc();
            ListToTable();
        }
        void ListToTable()
        {
            MonHoc mh;
           for(int i=0;i<lstMh.Count;i++)
           {
               mh=lstMh[i];
               monhocs.Rows.Add(mh.Mamh, mh.Tenmh, mh.Sotc, mh.Hocphi);
           }
            
        }
       

    }
}